# Contributor: Alex McGrath <amk@amk.ie>
# Maintainer: Patrycja Rosa <alpine@ptrcnull.me>
pkgname=py3-marshmallow
_pkgname=marshmallow
pkgver=3.23.1
pkgrel=0
pkgdesc="A lightweight library for converting complex objects to and from simple Python datatypes"
url="https://github.com/marshmallow-code/marshmallow"
arch="noarch"
license="MIT"
makedepends="py3-flit-core py3-gpep517 py3-wheel"
checkdepends="py3-pytest py3-tz py3-simplejson tzdata"
subpackages="$pkgname-pyc"
source="py3-marshmallow-$pkgver.tar.gz::https://github.com/marshmallow-code/marshmallow/archive/$pkgver.tar.gz"
builddir="$srcdir/$_pkgname-$pkgver"

build() {
	gpep517 build-wheel \
		--wheel-dir .dist \
		--output-fd 3 3>&1 >&2
}

check() {
	python3 -m venv --clear --without-pip --system-site-packages .testenv
	gpep517 install-wheel --destdir .testenv --prefix '' .dist/*.whl
	.testenv/bin/python3 -m pytest -k 'not test_unknown_parameter_value_is_validated'
}

package() {
	gpep517 install-wheel --destdir "$pkgdir" \
		.dist/*.whl
}

sha512sums="
5ec3171ebd2fbcad21e831ae5ad6f482f83af8f50d17f7868517d2702b093ff9084eb29c0e9e64a9619dcbfa96cda226a916a2078a74796c6eafbaebb5fc6176  py3-marshmallow-3.23.1.tar.gz
"
